 
import { uuid } from "../utils/Util";
export class BaseLayer {
  constructor(options) {
    this.options = options;
    this._uuid = uuid();
    this.options.id = Cesium.defaultValue(options.id, this._uuid);
    this.name = Cesium.defaultValue(options.name, '未命名')
    this._show = Cesium.defaultValue(options.show, true)
  }

  get uuid() {
    return this._uuid;
  }
  
  get id() {
    return this.options.id;
  }

  set id(id) {
    this.options.id = id;
  }

  _onAdd(map){
    this._map = map;
    this._mountedHook && this._mountedHook()
    this._addedHook && this._addedHook()
  }
}